package com.chanzany.interpreter;

import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpressionParser;

/**
 * @Author ChanZany
 * @Date 2021/10/20 13:41
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        SpelExpressionParser parser = new SpelExpressionParser();
        Expression expression = parser.parseExpression("5*(2+2)-2");
        int result = (int) expression.getValue();
        System.out.println(result);
    }
}
